import Koa from 'koa';
import Router from '@koa/router';
import bodyParser from 'koa-bodyparser';
import { functionCallingSample } from "./samples/function_calling"
import { embeddingSample } from './samples/embedding';
import { vec_search } from "./samples/vec_search"
// import { ragSample } from "./samples/reg"
embeddingSample()
vec_search()
// ragSample()
// functionCallingSample();

const app = new Koa();
const router = new Router();
// 使用中间件
app.use(bodyParser());
// 基础路由
router.get('/', async (ctx) => {
    ctx.body = {
        message: 'Welcome to LLM Application Study API'
    };
});

// 使用路由中间件
app.use(router.routes()).use(router.allowedMethods());

// 启动服务器
const PORT = process.env.PORT || 1999;
app.listen(PORT, () => {
    console.log(`Server is running on http://localhost:${PORT}`);
}); 